import Vue from 'vue';
import Router from 'vue-router';



Vue.use(Router);

// 登录页面
const Login = resolve => require(['../container/other/Login.vue'], resolve);
// 404页面
const NotFound = resolve => require(['../container/other/404.vue'], resolve);
const Home = resolve => require(['../components/common/Home.vue'], resolve);
// 商户资料
const MerchantInfo = resolve => require(['../container/MerchantInfo.vue'], resolve);
// 商户中心
const MerchantCenter = resolve => require(['../container/MerchantCenter.vue'], resolve);
// 消息
const Meaasge = resolve => require(['../container/Meaasge.vue'], resolve);
// 设备
const Equipment = resolve => require(['../container/Equipment.vue'], resolve);
// 维修单
const RepairList = resolve => require(['../container/RepairList.vue'], resolve);
// 投诉建议
const Proposal = resolve => require(['../container/Proposal.vue'], resolve);
// 财务报告
const Finance = resolve => require(['../container/Finance.vue'], resolve);
// 添加报告
const AddReport = resolve => require(['../container/AddReport.vue'], resolve);
// 修改报告
const UpdateReport = resolve => require(['../container/UpdateReport.vue'], resolve);
// 库存报告
const StockReport = resolve => require(['../container/StockReport.vue'], resolve);
// 库存管理
const StockManage = resolve => require(['../container/StockManage.vue'], resolve);
// 管理优惠券
const Coupon = resolve => require(['../container/Coupon.vue'], resolve);
// 查看优惠券监测
const CheckCouponMonitor = resolve => require(['../container/CheckCouponMonitor.vue'], resolve);
// 管理员工
const ManageStaff = resolve => require(['../container/ManageStaff.vue'], resolve);
// 设计考勤制度
const Efficiency = resolve => require(['../container/Efficiency.vue'], resolve);
// 关联设备设置
const RelevanceEquipment = resolve => require(['../container/RelevanceEquipment.vue'], resolve);


export default new Router({
    routes: [
        // !登录页面
        {
            path: '/',
            name: 'Login',
            component: Login,
            meta: {
                title: '登录'
            }
        }, {
            component: Home,
            path: '/Home',
            redirect: '/merchantInfo',
            children: [
                {
                    path: '/merchantInfo',
                    name: 'MerchantInfo',
                    component: MerchantInfo,
                    meta: {
                        title: '商户资料',
                        belong: 'merchantInfo'
                    }
                }, {
                    path: '/merchantCenter',
                    name: 'MerchantCenter',
                    component: MerchantCenter,
                    meta: {
                        title: '商户中心',
                        belong: 'merchantCenter'
                    }
                }, {
                    path: '/meaasge',
                    name: 'Meaasge',
                    component: Meaasge,
                    meta: {
                        title: '消息',
                        belong: 'meaasge'
                    }
                }, {
                    path: '/equipment',
                    name: 'Equipment',
                    component: Equipment,
                    meta: {
                        title: '设备',
                        belong: 'equipment'
                    }
                },{
                    path: '/repairList',
                    name: 'RepairList',
                    component: RepairList,
                    meta: {
                        title: '维修单',
                        belong: 'repairList'
                    }
                }, {
                    path: '/finance',
                    name: 'Finance',
                    component: Finance,
                    meta: {
                        title: '财务报告',
                        belong: 'finance'
                    }
                }, {
                    path: '/addReport',
                    name: 'AddReport',
                    component: AddReport,
                    meta: {
                        title: '添加报告',
                        belong: 'addReport'
                    }
                }, {
                    path: '/updateReport',
                    name: 'UpdateReport',
                    component: UpdateReport,
                    meta: {
                        title: '修改报告',
                        belong: 'updateReport'
                    }
                },{
                    path: '/stockManage',
                    name: 'StockManage',
                    component: StockManage,
                    meta: {
                        title: '库存管理',
                        belong: 'stockManage'
                    }
                }, {
                    path: '/stockReport',
                    name: 'StockReport',
                    component: StockReport,
                    meta: {
                        title: '库存报告',
                        belong: 'stockReport'
                    }
                }, 
                {
                    path: '/checkCouponMonitor',
                    name: 'CheckCouponMonitor',
                    component: CheckCouponMonitor,
                    meta: {
                        title: '查看优惠券监测',
                        belong: 'checkCouponMonitor'
                    }
                },
                {
                    path: '/coupon',
                    name: 'Coupon',
                    component: Coupon,
                    meta: {
                        title: '管理优惠券',
                        belong: 'coupon'
                    }
                }, 
                {
                    path: '/manageStaff',
                    name: 'ManageStaff',
                    component: ManageStaff,
                    meta: {
                        title: '管理员工',
                        belong: 'manageStaff'
                    }
                },
                {
                    path: '/efficiency',
                    name: 'Efficiency',
                    component: Efficiency,
                    meta: {
                        title: '设计考勤制度',
                        belong: 'efficiency'
                    }
                }, {
                    path: '/proposal',
                    name: 'Proposal',
                    component: Proposal,
                    meta: {
                        title: '投诉建议',
                        belong: 'proposal'
                    }
                }, {
                    path: '/relevanceEquipment',
                    name: 'RelevanceEquipment',
                    component: RelevanceEquipment,
                    meta: {
                        title: '投诉建议',
                        belong: 'relevanceEquipment'
                    }
                }
                
            ]
        }, {
            path: '*',
            component: NotFound,
            meta: {
                title: '找不到页面'
            }
        }
    ]
})
